package com.saint.swipemenulistview.activity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import com.saint.swipemenulistview.R;
import com.saint.swipemenulistview.runtimepermissions.PermissionsManager;
import com.saint.swipemenulistview.runtimepermissions.PermissionsResultAction;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        PermissionsManager.getInstance().requestAllManifestPermissionsIfNecessary(this, new PermissionsResultAction() {
            @Override
            public void onGranted() {
                Toast.makeText(MainActivity.this, "全部权限获取", Toast.LENGTH_SHORT).show();
            }

            @Override
            public void onDenied(String permission) {
                Toast.makeText(MainActivity.this, permission + "未获取", Toast.LENGTH_SHORT).show();
            }
        });
    }

    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.btn_1:
                SwipeMenuListActivity.startAct(this);
                break;
            case R.id.btn_2:
                new HttpTestActivity().startAct(this);
                break;
            case R.id.btn_3:
                new NotificationTestActivity().startAct(this);
                break;
            case R.id.btn_4:
                new EasemobActivity().startAct(this);
                break;
            case R.id.btn_5:
                new ImageAct().startAct(this);
                break;
            case R.id.btn_6:
                new ImageAct().startAct(this);
                break;
            default:
                break;
        }
    }


}
